
import 'package:flutter/material.dart';
import 'package:my_flutter/first/ui/page_article_collect.dart';
import 'package:my_flutter/first/ui/page_web_site_collect.dart';

import '../http/Api.dart';


class CollectPage extends StatefulWidget {
  const CollectPage({super.key});

  @override
  State<CollectPage> createState() => _CollectPageState();
}

class _CollectPageState extends State<CollectPage> {
  final tabs = ["文章", "网站"];

  @override
  Widget build(BuildContext context) {
    return  DefaultTabController(
      ///tab长度
      length: tabs.length,
      child:  Scaffold(
        appBar:  AppBar(
          backgroundColor: Colors.blue,
          leading: InkWell(
            onTap: () {
              Navigator.pop(context);
            },
            child: Icon(Icons.arrow_back,color: Colors.white),
          ),
          title:  Text('我的收藏',style: TextStyle(color: Colors.white),),
          bottom:  TabBar(
            indicatorColor: Colors.white,
            indicatorSize: TabBarIndicatorSize.tab,
            tabs: <Widget>[
               Tab(
                icon: Icon(Icons.article_outlined,size: 32.0,color: Colors.white),
              ),
               Tab(
                icon: Icon(Icons.web_sharp,size: 32.0,color: Colors.white),
              ),
            ],
          ),
        ),
        body:  TabBarView(
          children: <Widget>[
            ArticleCollectPage(),
            WebsiteCollectPage(),
          ],
        ),
      ),
    );
  }
}
